import datetime
from sqlalchemy import Boolean, Column, Integer, String, DateTime, ForeignKey

from app.db.database import Base


class trash(Base):
    """废品"""
    __tablename__ = 'trash'

    id = Column(Integer, primary_key=True, autoincrement=True)
    name = Column(String(255), nullable=False)
    waste_type = Column(String(255), nullable=False)
    waste_code = Column(String(255), nullable=False)
    waste_from = Column(String(255), nullable=False)
    waste_weight = Column(String(255), nullable=False)
    main_component = Column(String(255), nullable=False)
    Harmful_component = Column(String(255), nullable=False)
    note = Column(String(255), nullable=False)
    number_code = Column(String(255), nullable=False)
    unit = Column(String(255), nullable=False)
    contact = Column(String(255), nullable=False)
    remarks = Column(String(255), nullable=False)
    qrcode = Column(String(255), nullable=False)
    cast = Column(String(255), nullable=False)
    is_deleted = Column(Boolean, nullable=False, default=False)
    createdAt = Column(DateTime, default=datetime.datetime.now())

class Cast(Base):
    """危险特性"""
    __tablename__ = 'cast'

    id = Column(Integer, primary_key=True, autoincrement=True)
    name = Column(String(255), nullable=False)
    img_url=Column(String(255), nullable=False)
    is_deleted = Column(Boolean, nullable=False, default=False)
    createdAt = Column(DateTime, default=datetime.datetime.now())